package main;
/************************************/
/* A very simple Calculator in Java */
/* (c) Tom Mens, May 2001           */
/************************************/

// Version 0.0:
// ***********
// Only binary non-nested expressions are allowed.

public class CalculatorMain {
	
	private static void displayResult(Operation o) {
		System.out.println("The result of the operation:");
		o.print();
		System.out.println("is: " + o.compute());
		System.out.println();
	}

	// Here is an example of how to use the calculator:
	public static void main(String args[]) {
		displayResult(new Plus(3,4));
		displayResult(new Minus(5,4));
		displayResult(new Times(5,4));
		displayResult(new Divides(5,4));
	}

}
